--汇总
CREATE EXTERNAL TABLE jms_dm.dm_oms_order_mark_count_hi(
  pick_agent_code string COMMENT '取件代理区code',
  pick_agent_name string COMMENT '取件代理区code',
  field_name string COMMENT '标签',
  order_status_code string COMMENT '订单状态code',
  order_status_name string COMMENT '订单状态名称',
  date_time timestamp COMMENT '分区时间',
  mark_order_cnt int COMMENT '打标订单量',
  field_value string COMMENT '打标标签中文')
COMMENT '打标订单汇总'
PARTITIONED BY (
  dt string COMMENT '小时分区_订单打标时间,yyyy-MM-dd-HH')
ROW FORMAT SERDE
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  'hdfs://yl-bg-hdp/dw/hive/jms_dm.db/external/dm_oms_order_mark_count_hi'
;
-----明细
CREATE EXTERNAL TABLE jms_dm.dm_oms_order_mark_detail_hi(
  order_id bigint COMMENT '订单id', 
  waybill_id string COMMENT '运单号', 
  label_str string COMMENT '标签', 
  order_source_code string COMMENT '订单来源编码', 
  order_source_name string COMMENT '订单来源名称', 
  input_time timestamp COMMENT '录入时间', 
  order_status_code string COMMENT '订单状态编码', 
  order_status_name string COMMENT '订单状态名称', 
  pick_network_code string COMMENT '取件网点编码', 
  pick_network_name string COMMENT '取件网点名称', 
  sender_province_id string COMMENT '寄件省份id', 
  sender_province string COMMENT '寄件省份', 
  sender_city_id string COMMENT '寄件城市id', 
  sender_city string COMMENT '寄件城市', 
  sender_area_id string COMMENT '寄件区域', 
  sender_area string COMMENT '寄件区域', 
  sender_detailed_address string COMMENT '寄件详细地址', 
  receiver_province_id string COMMENT '收件省份id', 
  receiver_province string COMMENT '收件省份', 
  receiver_city_id string COMMENT '收件城市id', 
  receiver_city string COMMENT '收件城市', 
  receiver_area_id string COMMENT '收件区域', 
  receiver_area string COMMENT '收件区域', 
  receiver_detailed_address string COMMENT '收件详细地址', 
  change_type int COMMENT '网点类型:1-订单状态或者取件网点改变,2-订单标签变化', 
  customer_code string COMMENT '客户编码', 
  customer_name string COMMENT '客户名称', 
  pick_agent_code string COMMENT '取件网点code', 
  pick_agent_name string COMMENT '取件网点name')
COMMENT '订单表打标'
PARTITIONED BY ( 
  dt string COMMENT '时间分区 yyyy-MM-dd-HH')
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  'hdfs://yl-bg-hdp/dw/hive/jms_dm.db/external/dm_oms_order_mark_detail_hi'
;
